﻿<Window
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
  xmlns:local="clr-namespace:TeamBuildScreenSaver.Views"
	x:Class="TeamBuildScreenSaver.Views.Main"
	x:Name="Window" local:AttachedProperties.RegisterCommandBindings="{Binding Path=CommandBindings}"
	Title="Main" xmlns:b="clr-namespace:TeamBuildScreenSaver.Views" WindowStyle="None">
  <Window.Background>
    <RadialGradientBrush>
      <GradientStop Color="#FF000000" Offset="0.0" />
      <GradientStop Color="#FF333333" Offset="1.0" />
    </RadialGradientBrush>
  </Window.Background>
  <Grid x:Name="LayoutRoot">
    <ItemsControl d:UseSampleData="True" ItemsSource="{Binding Builds}">
      <ItemsControl.ItemTemplate>
        <DataTemplate>
          <Viewbox Margin="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.InnerMargin}">
            <b:BuildPanel DataContext="{Binding}"></b:BuildPanel>
          </Viewbox>
        </DataTemplate>
      </ItemsControl.ItemTemplate>
      <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
          <UniformGrid Columns="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}, Path=DataContext.Columns}" VerticalAlignment="Center"/>
        </ItemsPanelTemplate>
      </ItemsControl.ItemsPanel>
    </ItemsControl>
    <b:MessagePanel DataContext="{Binding ErrorMessageViewModel}"></b:MessagePanel>
    <Button Command="{Binding Path=Clicked}" Opacity="0"/>
  </Grid>
</Window>